package com.jobpass.common.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jobpass.common.insterface.MajorMapper;
import com.jobpass.common.model.Major;
import com.jobpass.common.service.MajorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author JobPass
 * @since 2020-07-17
 */
@Service
public class MajorServiceImpl extends ServiceImpl<MajorMapper, Major> implements MajorService {

    @Resource
    private MajorMapper majorMapper;
    @Override
    public List<Major> FindAllMajor() {
        return majorMapper.selectList(null);
    }

    @Override
    public Major FindMajorById(Long id) {
        return majorMapper.selectById(id);
    }

    @Override
    public int DeleteMajorById(Long id) {
        return majorMapper.deleteById(id);
    }

    @Override
    public int UpdateMajorById(Major major) {
        return majorMapper.updateById(major);
    }

    @Override
    public int SavaMajor(Major major) {
        return majorMapper.insert(major);
    }
}
